package com.swgk.core.view.entity;

import android.text.TextUtils;

import com.google.gson.annotations.SerializedName;
import com.stx.xhb.androidx.entity.BaseBannerInfo;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

public class EnterpriseEditEntity implements Serializable, BaseBannerInfo {

    private String key;
    @SerializedName(value = "name", alternate = {"val"})
    private String name;

    @SerializedName(value = "dtoList", alternate = {"companyList"})
    private List<EnterpriseRecEntity> dtoList;

    public String getKey() {
        return key;
    }

    public void setKey(String key) {
        this.key = key;
    }

    public String getName() {
        return TextUtils.isEmpty(name)?"成员":name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public EnterpriseEditEntity(List<EnterpriseRecEntity> dtoList) {
        this.dtoList = dtoList;
    }

    public List<EnterpriseRecEntity> getDtoList() {
        if (dtoList == null) {
            dtoList = new ArrayList<>();
        }
        return dtoList;
    }

    public void setDtoList(List<EnterpriseRecEntity> dtoList) {
        this.dtoList = dtoList;
    }

    @Override
    public List<EnterpriseRecEntity> getXBannerUrl() {
        return dtoList;
    }

    @Override
    public String getXBannerTitle() {
        return name;
    }
}
